import * as echarts from "echarts";
import { onUnmounted } from "vue";
export default function UserEcharts(divEl) {
    const echartsInstance = echarts.init(divEl, null, { renderer: "svg" })
    onUnmounted(() => {
        echartsInstance.dispose()
    })
    function setOptions(option) {
        echartsInstance.setOption(option)
    }
    function resizeEcharts() {
        echartsInstance.resize()
    }
    return {
        echartsInstance,
        setOptions,
        resizeEcharts
    }
}
